Filename | (eval 52)[/usr/share/perl5/Sub/Quote.pm:5] |
Statements | Executed 21 statements in 335µs |
Eval Invoked At | /usr/share/perl5/Sub/Quote.pm line 5 |
Sibling evals | 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18 |
Calls | P | F | Exclusive Time |
Inclusive Time |
Subroutine |
---|---|---|---|---|---|
2 | 2 | 2 | 23µs | 849µs | new | Search::Elasticsearch::Serializer::JSON::
1 | 1 | 1 | 12µs | 23µs | BEGIN@4 | Sub::Quote::
1 | 1 | 1 | 7µs | 7µs | BEGIN@7.5 | Method::Generate::Constructor::
Line | State ments |
Time on line |
Calls | Time in subs |
Code |
---|---|---|---|---|---|
1 | { | ||||
2 | 2 | 2µs | my $_QUOTED = ${$_[1]->{"\$_QUOTED"}}; | ||
3 | 1 | 300ns | my $default_for_JSON = ${$_[1]->{"\$default_for_JSON"}}; | ||
4 | 2 | 62µs | 2 | 34µs | # spent 23µs (12+11) within Sub::Quote::BEGIN@4 which was called:
# once (12µs+11µs) by Sub::Quote::_clean_eval at line 4 # spent 23µs making 1 call to Sub::Quote::BEGIN@4
# spent 11µs making 1 call to warnings::unimport |
5 | # spent 849µs (23+826) within Search::Elasticsearch::Serializer::JSON::new which was called 2 times, avg 425µs/call:
# once (6µs+792µs) by Search::Elasticsearch::new at line 40 of /opt/flows/lib/lib/perl5/Search/Elasticsearch.pm
# once (17µs+34µs) by Search::Elasticsearch::new at line 53 of Sub/Defer.pm | ||||
6 | package Method::Generate::Constructor; | ||||
7 | # spent 7µs within Method::Generate::Constructor::BEGIN@7.5 which was called:
# once (7µs+0s) by Sub::Quote::_clean_eval at line 12 | ||||
8 | 1 | 1µs | $^H = "2018"; | ||
9 | 1 | 500ns | ${^WARNING_BITS} = "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\003"; | ||
10 | 1 | 6µs | %^H = ( | ||
11 | ); | ||||
12 | 1 | 240µs | 1 | 7µs | } # spent 7µs making 1 call to Method::Generate::Constructor::BEGIN@7.5 |
13 | 1 | 500ns | my $class = shift; | ||
14 | 1 | 200ns | $class = ref($class) if ref($class); | ||
15 | 1 | 300ns | if ($class ne "Search::Elasticsearch::Serializer::JSON") { | ||
16 | if ($Moo::MAKERS{$class}) { | ||||
17 | Moo->_constructor_maker_for($class,"Search::Elasticsearch::Serializer::JSON"); | ||||
18 | return $class->new(@_); | ||||
19 | } elsif ($INC{"Moose.pm"} and my $meta = Class::MOP::get_metaclass_by_name($class)) { | ||||
20 | return $meta->new_object($class->BUILDARGS(@_)); | ||||
21 | } | ||||
22 | } | ||||
23 | 1 | 100ns | my $args; | ||
24 | 1 | 800ns | if ( scalar @_ == 1 ) { | ||
25 | 1 | 800ns | unless ( defined $_[0] && ref $_[0] eq 'HASH' ) { | ||
26 | die "Single parameters to new() must be a HASH ref" | ||||
27 | ." data => ". $_[0] ."\n"; | ||||
28 | } | ||||
29 | 1 | 2µs | $args = { %{ $_[0] } }; | ||
30 | } | ||||
31 | elsif ( @_ % 2 ) { | ||||
32 | die "The new() method for $class expects a hash reference or a key/value list." | ||||
33 | . " You passed an odd number of arguments\n"; | ||||
34 | } | ||||
35 | else { | ||||
36 | $args = {@_}; | ||||
37 | } | ||||
38 | 1 | 1µs | my $new = bless({}, $class);; | ||
39 | 1 | 6µs | 1 | 34µs | $new->{"JSON"} = ( # spent 34µs making 1 call to Search::Elasticsearch::Serializer::JSON::__ANON__[/opt/flows/lib/lib/perl5/Search/Elasticsearch/Serializer/JSON.pm:6] |
40 | exists $args->{"JSON"} | ||||
41 | ? $args->{"JSON"} | ||||
42 | : $default_for_JSON->($new) | ||||
43 | ); | ||||
44 | 1 | 800ns | $new->{"mime_type"} = ( | ||
45 | exists $args->{"mime_type"} | ||||
46 | ? $args->{"mime_type"} | ||||
47 | : "application/json" | ||||
48 | ); | ||||
49 | 1 | 4µs | return $new; | ||
50 | } | ||||
51 | 1 | 1µs | $_QUOTED->[3] = \&Search::Elasticsearch::Serializer::JSON::new | ||
52 | } | ||||
53 | 1 | 5µs | 1; | ||
54 | |||||
55 | ; |